package com.yuju.account.dao.impl;

import com.yuju.account.model.ShiftAccountModel;
import com.yuju.common.PageModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.yuju.account.dao.IShiftDao;
import com.yuju.account.dao.entity.Shift;
import com.yuju.account.dao.mapper.ShiftMapper;
import com.yuju.account.model.ShiftModel;
import com.yuju.common.core.dao.AbstractBaseDao;
import com.yuju.persist.base.mapper.BaseMapper;

import java.util.List;
import java.util.Map;

/**
 * 类名：ShiftDaoImpl  <br />
 *
 * 功能：
 *
 * @author : jiaokn <br />
 * @Date : 2017年12月7日 下午5:15:59  <br />
 * @version : 1.1 <br />
 */
@Repository
public class ShiftDaoImpl extends AbstractBaseDao<ShiftModel, Shift, String> implements IShiftDao {
	
	@Autowired
	private ShiftMapper shiftMapper;
	
	@Override
	public BaseMapper<Shift, String> getMapper() {
		return shiftMapper;
	}

	@Override
	public List<ShiftModel> getCurrentShift(String hotelId){
		Shift shift = new Shift();
		shift.setHotelId(hotelId);
		return convertP2M(shiftMapper.getCurrentShift(shift));
	}

	@Override
	public int insertShiftInfo(ShiftModel shift){
		return shiftMapper.insertShiftInfo(convert(shift));
	}

	@Override
	public List<ShiftModel> queryShiftInfo(ShiftModel shiftModel){
		return shiftMapper.queryShiftInfo(shiftModel);
	}

	@Override
	public List<ShiftAccountModel> queryShiftAccountInfo(ShiftAccountModel shiftAccountModel){
		return shiftMapper.queryShiftAccountInfo(shiftAccountModel);
	}

	@Override
	public ShiftModel getPreviousShift(String hotelId){
		ShiftModel shiftModel = new ShiftModel();
		shiftModel.setHotelId(hotelId);
		return shiftMapper.getPreviousShift(shiftModel);
	}

	@Override
	public List<ShiftModel> getShiftBaseInfo(ShiftModel shiftModel){
		return shiftMapper.getShiftBaseInfo(shiftModel);
	}


}
